<?php /* Smarty version 2.6.26, created on 2012-11-22 15:25:36
         compiled from mmatrix_master_index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_radios', 'mmatrix_master_index.html', 75, false),array('function', 'cycle', 'mmatrix_master_index.html', 121, false),array('modifier', 'date_format', 'mmatrix_master_index.html', 124, false),)), $this); ?>
<?php echo '<?xml'; ?>
 version="1.0" encoding="utf-8"<?php echo '?>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<link type="text/css" href="./assets/styles/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			/*
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			*/
			$('#btn-export').click(function(){	
				if(confirm('ダウンロードしますか？')){
					document.fm.csv.value="download";
					document.fm.submit();
					
				}
			});
			
			$('#btn_search').click(function(){	
				document.fm.csv.value="";
				document.fm.submit();
			});
			$('#btn-reset').click(function(){	
				location.href = document.fm.action;
			});
			$('#btn-add').click(function(){	
				var thesort = $('input[@name=sort][checked]').val(); 
				location.href = "mmatrix_master_form.php?sort=" + thesort ;
			});
		});
		function toPage(thepage) {
			document.fm.page.value =  thepage;
			document.fm.csv.value="";
			document.fm.submit();
		}
		</script>
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
	</head>
	<body id="">
<?php echo $this->_tpl_vars['menu']; ?>

<?php echo $this->_tpl_vars['logout']; ?>

		<div id="container"><div class="wrapper">
			<h2>マトリックスマスター管理</h2>
			<ul class="submenu clearfix">
				<li><a href="mmatrix_index.php">マトリックス情報一覧</a></li>
				<li><a href="mmatrix_form.php">マトリックス情報登録</a></li>
				<li>コードマスタ</li>
			</ul>
			<h3>コードマスタ一覧</h3>
			<form name="fm" id="fm" method="get" action="mmatrix_master_index.php" >
				<input type="hidden" name="page" />
				<table class="formTable">
					<tbody>
							<tr>
							<th>※種類</th>
							<td>
<?php echo smarty_function_html_radios(array('class' => 'sort','id' => 'sort','name' => 'sort','options' => $this->_tpl_vars['sorts'],'selected' => $this->_tpl_vars['forms']['sort'],'separator' => '&nbsp;&nbsp;&nbsp;'), $this);?>

<input type="hidden" name="hsort"  value = "<?php echo $this->_tpl_vars['forms']['sort']; ?>
"/>
							</td>
						</tr>
<!--  
						<tr>
							<th>コード</th>
							<td>
								<input type="text" name="cd" value="<?php echo $this->_tpl_vars['forms']['cd']; ?>
" class="text" />
							</td>
						</tr>
						<tr>
							<th>名称</th>
							<td>
								<input type="text" name="name" value="<?php echo $this->_tpl_vars['forms']['name']; ?>
" class="text" />
							</td>
						</tr>
						-->
					</tbody>
				</table>
				<p class="button" style="text-align:right">
					<button type="button" id="btn-reset"><span>クリア</span></button>
					<button type="button" id="btn_search" class="submit"><span>絞込検索</span></button>
				</p>
				<input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
			</form>
		<p class="button" style="text-align:left">
			<button type="button" id="btn-add"  ><span>新規追加</span></button>
		</p>
<?php if (is_numeric ( $this->_tpl_vars['page']['cnt'] )): ?>
<?php if ($this->_tpl_vars['page']['cnt'] > 0): ?>
			<p class="message"><?php echo $this->_tpl_vars['page']['cnt']; ?>
件の情報が見つかりました。</p>
			<p align="left"><?php echo $this->_tpl_vars['pageing']; ?>
</p>
			<table id="search_result" class="sortable">
				<thead>
					<tr>
						<th><h3>コード</h3></th>
						<th><h3>名称</h3></th>
						<th><h3>更新日時</h3></th>
						<th><h3>更新者</h3></th>
						<th><h3>操作</h3></th>
					</tr>
				</thead>
				<tbody>
<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
        $this->_foreach['member']['iteration']++;
?>
					<tr class="<?php echo smarty_function_cycle(array('values' => "odd,mod",'name' => 'member'), $this);?>
">
						<td><?php echo $this->_tpl_vars['v']['cd']; ?>
</td>
						<td><?php echo $this->_tpl_vars['v']['name']; ?>
</td>
						<td class="center"><?php echo ((is_array($_tmp=$this->_tpl_vars['v']['u_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M")); ?>
</td>
						<td ><?php echo $this->_tpl_vars['v']['m_user_name']; ?>
</td>
						<td class="center"><a href="mmatrix_master_form.php?id=<?php echo $this->_tpl_vars['v']['id']; ?>
&sort=<?php echo $this->_tpl_vars['v']['sort']; ?>
">[更新]</a></td>
					</tr>
<?php endforeach; endif; unset($_from); ?>
				</tbody>
			</table>
			<p align="right"><?php echo $this->_tpl_vars['pageing']; ?>
</p>

				<p class="button">
					<button type="button" id="btn-export"  ><span>CSVダウンロード</span></button>
				</p>
<?php else: ?>
<p class="message">条件にマッチする情報は見つかりませんでした。</p>
<?php endif; ?>
<?php else: ?>
	<p class="message">ここに検索結果が表示されます。</p>
<?php endif; ?>

		</div></div>
		<?php echo $this->_tpl_vars['footer']; ?>

	</body>
</html>